﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using hedefgrup.reports.renault;
using hedefgrup.reports.renault.definitions;
using hedefgrup.reports.renault.implementation;

public partial class rankingResultsCriteria : criteriaPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        base.initialize();
        base.ensureUserIsLoggedIn();

        base.renderMonthSelection(monthSelection);
        base.renderNetworkSelection();

        base.renderMakeSelection(makeSelection);

        reportDefinition report = base.getDataCache().reportDefinitions["dealerTargets"];
        foreach (reportRowDefinition rowDefinition in report.rowDefinitions)
        {
            questionDefinition qDef = base.getDataCache().questionDefinitions[rowDefinition.getQuestionToReport()];
            if (!string.IsNullOrEmpty(rowDefinition.getAttributeByName("h")))
            {
                rankingCriteria.Items.Add(new ListItem(rowDefinition.getAttributeByName("h"), qDef.getCode() + ":" + rowDefinition.getAttributeByName("o")));
            }
            else
            {
                rankingCriteria.Items.Add(new ListItem(qDef.getCode() + " - " + qDef.getName(), qDef.getCode() + ":" + rowDefinition.getAttributeByName("o")));
            }
        }

        isQVOOrDacia.Text = base.userProjectName.ToLowerInvariant() == Global.PROJECT_QVO || base.userProjectName.ToLowerInvariant() == "dacia" ? "true" : "false";

    }
}
